package com.bigdata.appliance.controller;

import com.bigdata.appliance.service.IUploadService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author movie
 * @since 2023-10-26
 */
@RestController
@RequestMapping("/api")
@Api(tags = "上传模块")
public class UploadController {

    @Resource
    private IUploadService iUploadService;

    @PostMapping("/admin/upload")
    public String upload(@RequestParam("file") MultipartFile file) {
        return iUploadService.upload(file);
    }
}
